#include <stdio.h>
int a[16]={2, 3, 5, 7, 11, 13, 17, 23, 29, 31, 34, 71, 79, 97, 103};
void display()
{
    int i;
    for(i=0; i<16; i++) printf("%d ", a[i]);
}
int main()
{
    int i,n;
    scanf("%d",&n);
    for(i=14;i>=0;i--)
    {
        if(a[i]>n)a[i+1]=a[i];
        else break;
    }
    a[i+1]=n;
    display();
    return 0;
}
